import {http} from "../config.js"

//立即下单 POST /front/order/create
export const createOrder = (params) =>{
	return http.post('front/order/create',params)
}

//从购物车下单 POST /front/order/createByCart
export const cartCreateOrder = (params) =>{
	return http.post('front/order/createByCart',params)
}

//  我卖出的订单列表   POST /front/order/get/mySaleList
export const mySaleList = (params) =>{
	return http.post('front/order/get/mySaleList',params)
}

// 订单列表	POST /front/order/get/orderList
// status    1 待付款---2 待处理  ---3 待发货 ---4 待收货呢 ---5 已完成	---6 取消---7 关闭---8 预售中
// orderType 1 待预售---2 预售着  ---3 自用呢 ---4 预售自用 ---5 预售卖出 
export const getOrderList = (params) =>{
	return http.post('front/order/get/orderList',params,true,false)
}

// 获取订单详情POST /front/order/get/orderInfo
export const getOrderInfo = (params) =>{
	return http.post('front/order/get/orderInfo',params)
}


// 确认收货POST /front/order/receipt
export const receiptOrder = (params) =>{
	return http.post('front/order/receipt',params)
}

// 取消订单POST /front/order/cancel
export const cancelOrder = (params) =>{
	return http.post('front/order/cancel',params)
}

// 发布预售POST /front/order/consignment
export const consignmentOrder = (params) =>{
	return http.post('front/order/consignment',params)
}

// 商品申请自用	POST /front/order/selfUseByGoods
export const selfGoodsOrder = (params) =>{
	return http.post('front/order/selfUseByGoods',params)
}
// 订单申请自用	POST /front/order/selfUseByOrder
export const selfUseOrder = (params) =>{
	return http.post('front/order/selfUseByOrder',params)
}

//去支付 POST /front/order/to/pay
export const toPay = (params) =>{
	return http.post('front/order/to/pay',params)
}
//订单支付 POST /front/order/pay
export const pay = (params) =>{
	return http.post('front/order/pay',params)
}


// 商品上下架POST /goods/update/status
export const goodsUpdateStatus = (params) =>{
	return http.post('goods/update/status',params)
}


// 获取分组列表 GET /front/user/share/group/get/group/list
export const getGroupList = (params) =>{
	return http.get('front/user/share/group/get/group/list',params)
}
// 获取分组商品列表GET /front/user/share/group/get/group/goods/list
export const getGroupGoodsList = (params) =>{
	return http.get('front/user/share/group/get/group/goods/list',params)
}

// 创建分组POST /front/user/share/group/create/group
export const  createGroup = (params) =>{
	return http.post('front/user/share/group/create/group',params)
}

// 删除分组	POST /front/user/share/group/delete/group
export const  deleteGroup = (params) =>{
	return http.post('front/user/share/group/delete/group',params)
}

// 修改分组名称POST /front/user/share/group/update/group
export const  upDateGroup = (params) =>{
	return http.post('front/user/share/group/update/group',params)
}

// 修改分组商品	POST /front/user/share/group/update/group/goods
export const  upDateGoodsGroup = (params) =>{
	return http.post('front/user/share/group/update/group/goods',params)
}
// 删除分组的商品 POST /front/user/share/group/delete/group/goods
export const  deleteGroupGoods = (params) =>{
	return http.post('front/user/share/group/delete/group/goods?',params)
}
// 查询订单状态 get /search/sandpay/getOrderByOrderId
export const  getOrderByOrderId = (params) =>{
	return http.get('search/sandpay/getOrderByOrderId',params,true,false)
}


